import React from 'react'
import Department from "components/template/department"

export default {
  key: 'department',
  name: 'Department 部门',
  author: '吴程龙',
  description: '选择部门',
  isExampleFull: true,
  api: [{
    title: 'API',
    data: [{
      param: 'isNeedCompany', description: '是否只查找登录人所属公司下的部门', type: 'bool', defaultValue: 'false'
    }, {
      param: 'needEntity', description: '是否区分虚拟部门与实体部门', type: 'bool', defaultValue: 'false'
    }, {
      param: 'showCompany', description: '是否含有公司搜索', type: 'bool', defaultValue: 'false'
    }, {
      param: 'value', description: '选中的部门值', type: 'Array', defaultValue: '[]'
    }, {
      param: 'single', description: '是否单选', type: 'bool', defaultValue: 'false'
    }, {
      param: 'parser', description: '需要获取的对象格式', type: 'item => ({})', defaultValue: '看代码内部'
    }],
    description: '不太想写labelKey和valueKey，因为想定死后台，展示内容由parser的数据结构决定，其中title > name > path'
  }],
  example: [
    {
      title: '基础用法',
      description: '',
      state: {

      },
      getMethod: context => {
        return {

        }
      },
      getContent: context => {
        return (
          <div>
            <Department
              parser={item => ({
                title: item.name || item.path,
                id: item.id
              })}
              showCompany
            />
          </div>
        )
      }
    }
  ]
}
